package com.ywz.project.system.controller;

import com.ywz.common.ResultResp;
import com.ywz.project.system.dto.req.LoginLogPageReq;
import com.ywz.project.system.service.SysLoginLogApiService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 类描述 -> 系统登录日志API
 *
 * @Author: ywz
 * @Date: 2024/10/27
 */
@Api(tags = "系统登录日志API")
@RestController
@RequestMapping("/system/sysLoginLog")
public class SysLoginLogApiController {
    @Resource
    private SysLoginLogApiService sysLoginLogApiService;

    /**
     * 方法描述 -> 分页查询系统登录日志
     *
     * @param req -> 请求参数
     * @Author: ywz
     * @Date: 2024/11/05
     */
    @GetMapping("/getLoginLogPage")
    @ApiOperation(value = "分页查询系统登录日志", httpMethod = "GET")
    public ResultResp getLoginLogPage(LoginLogPageReq req) {
        return sysLoginLogApiService.getLoginLogPage(req);
    }

    /**
     * 方法描述 -> 删除系统登录日志
     *
     * @param ids -> 日志ID
     * @Author: ywz
     * @Date: 2024/11/24
     */
    @DeleteMapping("/removeLoginLog")
    @ApiOperation(value = "删除系统登录日志", httpMethod = "DELETE")
    public ResultResp removeLoginLog(String ids) {
        return sysLoginLogApiService.removeLoginLog(ids);
    }

}
